﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebLayer.TableParsers
{
    public class ClassActionRequest
    {
        static public string LastMessage(LastMessageType msgType, LoginToken token)
        {
            LastMessagePage page = new LastMessagePage(msgType);
            page.LoginToken = token;
            page.Request();
            return page.Message;
        }

        static public string ReserveClass(int id, LoginToken token)
        {
            ReserveClassPage page = new ReserveClassPage(id.ToString());
            page.LoginToken = token;
            page.Request();

            return LastMessage(LastMessageType.Reserve, token);
        }

        static public string CancelClass(int id, LoginToken token)
        {
            CancelReservationPage page = new CancelReservationPage(id.ToString());
            page.LoginToken = token;
            page.Request();

            return LastMessage(LastMessageType.Cancel, token);
        }

        
    }
}
